package com.ganjingcun.roma.persist.model;


import java.sql.Date;

/**
 * Created by linus on 16/4/15.
 */
public class Report {

    private Integer request ;

    private Integer fill =0 ;

    private Integer imp = 0 ;

    private Integer click = 0;

    private String name ;

    private Date day ;

    public Integer getRequest() {
        return request;
    }

    public void setRequest(Integer request) {
        this.request = request;
    }

    public Integer getFill() {
        return fill;
    }

    public void setFill(Integer fill) {
        this.fill = fill;
    }

    public Integer getImp() {
        return imp;
    }

    public void setImp(Integer imp) {
        this.imp = imp;
    }

    public Integer getClick() {
        return click;
    }

    public void setClick(Integer click) {
        this.click = click;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getDay() {
        return day;
    }

    public void setDay(Date day) {
        this.day = day;
    }

    public String clickRate(){
        double c = click ;
        double r = request ;
        double rate = c / r * 100;
        return rate + "%" ;
    }

    public String fillRate(){
        double c = fill ;
        double r = request ;
        double rate = c / r * 100;
        return rate + "%" ;
    }

    public String impRate(){
        double c = imp ;
        double r = request ;
        double rate = c / r * 100;
        return rate + "%" ;
    }

    @Override
    public String toString() {
        return "Report{" +
                "day=" + day +
                ", name='" + name + '\'' +
                ", click=" + click +
                ", imp=" + imp +
                ", fill=" + fill +
                ", request=" + request +
                ", clickRate=" + clickRate() +
                ", fillRate=" + fillRate() +
                ", impRate=" + impRate() +
                '}';
    }
}
